home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8497 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: BIX.com!agurski
  2. From: agurski@BIX.com (agurski on BIX)
  3. Newsgroups: comp.lang.c,comp.lang.c++,comp.os.ms-windows.programmer.misc,comp.os.msdos.programmer,comp.programming,comp.windows.ms.programmer
  4. Subject: Re: Date Arithmetic
  5. Date: 16 Feb 96 08:31:54 GMT
  6. Organization: Delphi Internet Services Corporation
  7. Message-ID: <agurski.824459514@BIX.com>
  8. References: <4g19kp$640@tracy.protocom.com>
  9. NNTP-Posting-Host: bix.com
  10.  
  11. "Michael J. Karas" <mkaras@pclink.com> writes:
  12.  
  13. >I am working on an algorithm for a laser marking machine that writes
  14. >expiration delays on to food product boxes. The algorithm needs to 
  15. >be able to add NNN days to todays date in the fastest manner possible
  16. >without using any floating point arithmetic. I could use help from anyone
  17. >that has C code for doing this. It would be nice if the solution took the
  18. >leap year problem in to account including the special case of the year 
  19. >2000. Thanks in advance to anyone who could share their knowledge on this 
  20. >subject.
  21. >-----
  22. >Michael Karas             | EMail: mkaras@pclink.com
  23. >Carousel Design Solutions | America OnLine: MJKaras
  24. >6021 Logan Avenue South   | Voice: (612) 861-1284
  25. >Minneapolis MN 55419      | Fax:   (612) 861-1386
  26. >-----
  27.  
  28.  
  29. -------------------------
  30. Check algorithm 199 "Conversion between calendar date and Julian day
  31. number" by Robert G. Tantzen in "Collected Algorithms from CACM",
  32. published by the ACM (Association for Computing Machines). The two
  33. routines there will do the trick for you.
  34.  
  35.                                     -- Aron
  36.